﻿using System;
using System.Windows.Controls;
using CSharpHelpers.IOs;

namespace CSharpHelpers.Wpfs
{
    class WpfHelper
    {
        /// <summary>
        /// 切换页面
        /// </summary>
        /// <param name="fromPage"></param>
        /// <param name="toPageIndex"></param>
        public static void ExchangePage(Page fromPage, int toPageIndex)
        {
            try
            {
                if (fromPage.NavigationService != null)
                {
                    fromPage.NavigationService.Navigate(new Uri("PageTable.xaml", UriKind.Relative));
                }
            }
            catch (Exception ex)
            {
                SystemLog.Error("页面切换异常：" + ex);
            }
        }
    }
}
